package com.dd.serivce.impl;

import com.dd.mapper.AddressMapper;
import com.dd.mapper.RoleMapper;
import com.dd.mapper.UserMapper;
import com.dd.pojo.Address;
import com.dd.pojo.User;
import com.dd.serivce.UserSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserSerice implements UserSerivce {
     @Autowired
     private UserMapper userMapper;
     @Autowired
     private RoleMapper roleMapper;
     @Autowired
     private AddressMapper addressMapper;

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public User loginIf(String name, String password) {
        User user = userMapper.loginIf(name, password);
        return userMapper.loginIf(name,password);
    }
}
